package cn.janescott.file.server;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 日期格式化
 *
 * @author scott
 * @date 2019/4/15
 */
public class DateFormatter {

    public static void main(String[] args) {
        LocalDateTime date = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd(HH-mm-ss)");
        String text = date.format(formatter);
        System.out.println(text);
//        LocalDate parsedDate = LocalDate.parse(text, formatter);

    }

}
